package com.zhiyou100.taxi.test;

import com.zhiyou100.taxi.dao.CarMapper;
import com.zhiyou100.taxi.dao.RoleMapper;
import com.zhiyou100.taxi.entity.Car;
import com.zhiyou100.taxi.entity.Customer;
import com.zhiyou100.taxi.entity.Role;
import com.zhiyou100.taxi.entity.RoleExample;
import com.zhiyou100.taxi.service.*;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import java.util.List;

/**
 * @author zhaokuii11@163.com
 * @create 2021-11-23 16:56
 * @Description
 */
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = {"classpath:spring/spring-mvc.xml", "classpath:spring/spring-mybatis.xml"})

public class HelloWorld {
    @Autowired
    CustomerService customerService;
    @Autowired
    CarService carService;
    @Autowired
    CarOutService carOutService;
    @Autowired
    RoleService roleService;

    @Test
    public void test2() {
//        System.out.println(carInService.getPrimaryKey());
//        System.out.println(carInService.getOneUnionByPrimaryKey("car_id_108"));
        System.out.println(roleService.getOneUnion("role_03"));
    }

    @Test
    public void test1() {

//        Customer customer = customerService.getCustomerByPid("410186198502222223");
//        System.out.println("customer = " + customer);
//        Customer customer1 = new Customer(null, "吉良吉影", "男", "18438860920",
//                "432432432434", "AA", "杀杀杀", "/imgs/default.jpg");
//        String primaryKey = customerService.getPrimaryKey();
//        customer1.setCustomerId(primaryKey);
//        customerService.saveCustomer(customer1);
        Customer customer_003 = customerService.getCustomerByPrimaryKey("customer_003");
        System.out.println("customer_003 = " + customer_003);


    }
    
}
